<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>资金分解单查看</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<form id="capFund_form">
    <div class="fieldset1 tabel_col tabel_col_1 clearFix">
        <div class="caption">
            <span class="title">来款信息</span>
        </div>
        <div class="fieldBox col_33">
            <div class="label">资金编号</div>
            <div class="field">
                ${capFundVO.code}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">凭证种类</div>
            <div class="field">
                ${capFundVO.certificateCd}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">凭证号码</div>
            <div class="field">
                ${capFundVO.certificateCode}
            </div>
        </div>

        <div class="fieldBox col_33">
            <div class="label">资金状态</div>
            <div class="field">
                ${capFundVO.fundStatusCdNm}
            </div>
        </div>

        <div class="fieldBox col_33">
            <div class="label">收款户名</div>
            <div class="field">
                ${capFundVO.acceptName}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">收款账号</div>
            <div class="field">
                ${capFundVO.acceptCode}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">来款户名</div>
            <div class="field">
                ${capFundVO.comeName}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">来款账户</div>
            <div class="field">
                ${capFundVO.comeCode}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">收到金额</div>
            <div class="field">
                <span id="comeAmt"></span>
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">客户名称</div>
            <div class="field">
                ${capFundVO.cstNm}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">资金到账日期</div>
            <div class="field">
                ${capFundVO.acceptDates}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">实际到账日期</div>
            <div class="field">
                ${capFundVO.acceptActualDates}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">待分解金额</div>
            <div class="field">
                <span id="availableAmt"></span>
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">导入人</div>
            <div class="field">
                ${capFundVO.crtUsrNm}
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">认款人</div>
            <div class="field">
                ${capFundVO.identifyOperatorNm}
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">摘要</div>
            <div class="field">
                ${capFundVO.docketRem}
            </div>
        </div>
    </div>

    <div class="fieldset1 tabel_col clearFix">
        <div class="caption">
            <span class="title">分解明细</span>
        </div>
        <div class="fieldBox col_100">
            <div id="ligergrid_vflist" class="sq-grid"></div>
        </div>

        <div class="btnsBox" style="text-align: center;">
            <span id="close_Btn" class="sq-button sq-button-round l-dialog-btn-ok">关闭</span>
        </div>
    </div>
</form>
<script>
    var payListGrid=null,decomListGrid;
    $(function () {
        $("#comeAmt").text(FormatMoney(parseFloat('${capFundVO.amount}')/100));
        $("#availableAmt").text(FormatMoney(parseFloat('${capFundVO.availableAmount}')/100));

        decomListGrid=$("#ligergrid_vflist").ligerGrid({
            url: '<%=path%>/capital/capFund/searchVfLogList.do',
            parms:{fundId:'${capFundVO.id}',vfId:'${vfId}'},
            method: 'get',
            columns: [
                {display: '分解/冲红单号', name: 'vfNo', minWidth: 170,align: 'left'},
                {display: '核销方式', name: 'vfTypCdNm', width: 100,align: 'center'},
                {display: '核销金额', name: 'vfAmt', width: 100,align: 'right',
                    render:function(rowdata,index,value){
                        return '&yen;'+FormatMoney(rowdata.vfAmt/100);
                    }
                },
                {display: '核销人', name: 'vfUsrNm', width: 100,align: 'center'},
                {display: '核销时间', name: 'vfTm', width: 140,align: 'center',render:renderDate},
                {display: '备注', name: 'vfRem', width: 240,align: 'left',isEllipsis:false},
                {display: '审核状态', name: 'vfStsCdNm', minWidth: 100,align: 'center'},
            ],
            usePager: false,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            heightDiff: -2,
            isScroll: false,
            allowUnSelectRow: true,
            alternatingRow: false,
            fixedCellHeight:false,
            onAfterShowData: function () {
                this.extendDetailAll(); //展开全部Detail
                //this.extendDetail(0); //展开指定行的Detail
            },
            onBeforeShowData: function ()
            {
                var grid = this;
                grid.collapsedRows = [];
            },
            detail: {
                height: 'auto',
                onShowDetail: showDetail_grid
            }
        });

        /*关闭*/
        $("#close_Btn").click(function (event) {
            Remove_navTab();
        });

    });

    function showDetail_grid(row, detailPanel, callback){
        var gridBox = document.createElement('div');
        $(gridBox).css('margin', 5);
        $(detailPanel).css({
            'padding': 10,
            'box-sizing': 'border-box'
        }).append(gridBox);
        detailGrid = $(gridBox).ligerGrid({
            url: '<%=path%>/capital/capFund/searchVfDtlList.do?vfId='+row.id+"&fundId="+row.fundId,
            method: 'get',
            columns: [
                {display: '应收项目', name: 'feeTypCdNm', minWidth: 100,align: 'center'},
                {display: '支付表号', name: 'paySchNo', minWidth: 100 ,align: 'left'},
                {display: '应收日期', name: 'payDt', minWidth: 100,align: 'center',render:renderDate2},
                {display: '应收金额', name: 'payFeeAmt', minWidth: 100,align: 'right',
                    render:function(rowdata,index,value){
                        return '&yen;'+FormatMoney(rowdata.payFeeAmt/100);
                    }
                },
                {display: '实收金额', name: 'vfAmt', minWidth: 100,align: 'right',
                    render:function(rowdata,index,value){
                        return '&yen;'+FormatMoney(rowdata.vfAmt/100);
                    }
                },
            ],
            usePager: false,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: 300,
            heightDiff: -2,
            isScroll: false,
            rownumbers: true,
            allowUnSelectRow: true,
            alternatingRow: false,
            onAfterShowData: callback,
            frozen: false,
        });
    }

    //格式化时间
    function renderDate(rowdata, index, value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DDHHMMSS);
        }
        return dateStr;
    }
    function renderDate2(rowdata, index, value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
        }
        return dateStr;
    }

</script>
</body>
</html>
